// lib/ui/order/order_page.dart
import 'package:flutter/material.dart';
import 'package:flutter_deer/database/beans/order/order_list_bean_entity.dart';
import 'package:flutter_deer/ui/order/order_detail_page.dart';
import 'package:flutter_deer/ui/order/order_list_page.dart';

class OrderPage extends StatefulWidget {
  const OrderPage({super.key});

  @override
  State<OrderPage> createState() => _OrderPageState();
}

class _OrderPageState extends State<OrderPage> {
  OrderListBeanList? _selectedOrder;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Row(
        children: [
          // 左侧订单列表
          SizedBox(
            width: 500,
            child: OrderListPage(
              onOrderSelected: (order) {
                setState(() {
                  _selectedOrder = order;
                });
              },
            ),
          ),
          // 右侧分割线
          Container(
            width: 1,
            color: Colors.grey[300],
          ),
          // 右侧订单详情
          Expanded(
            child: OrderDetailPage(order: _selectedOrder),
          ),
        ],
      ),
    );
  }
}
